Skip to content

Entries tagged "sandy bridge".

Hardware accelerated video playback on EL6 (RHEL, Centos, SL) and Intel SandyBridge

Recently I got to play with a linux laptop that had an NVidia card and was impressed by how well and efficient mplayer is when using VDPAU.
My personal laptop however is an all-Intel one with a 2nd generation i5 SandyBridge CPU and no NVidia GPU, but an Intel HD 3000. This is quite a popular setup nowadays and this is actually great because it turns out we can have hardware accelerated playback using entirely open source software, no binary blob required. Linus will be happy. :-)

Don't get me wrong, this is a great machine and mplayer uses around 30% of one core when playing 1080p video, however this is no match for the under 10% when using NVidia's VDPAU.

So let's start. What we need is LibVA from splitted-desktop.com and gstreamer-vaapi (to enable acceleration in Totem) or/and a version of mplayer with VAAPI patches. I'll assume you are using Stella or EL6 with my repo nux-dextop.

yum install libva-freeworld gstreamer-vaapi
And that's it, open some HD content in Totem (aka Movie Player) and behold low CPU usage.

Thanks to Tux99 at SL forum for packaging gstreamer-vaapi.

If you want to use mplayer though we need to work a bit more and build it from source (until I'll make a package of it).
We need to install some development packages first:
yum install gcc make freetype-devel alsa-lib-devel pulseaudio-libs-devel yasm-devel patch subversion libva-freeworld-devel

Next we need to get mplayer-vaapi and build it:
cd ~/Downloads
wget http://www.splitted-desktop.com/static/libva/mplayer-vaapi/mplayer-vaapi-20110127.tar.bz2
tar xjf mplayer-vaapi-20110127.tar.bz2
cd mplayer-vaapi-20110127
./checkout-patch-build.sh
...wait for the build process to finish then you can merely copy the mplayer binary to somewhere in the path and that's it - we do this not to overwrite or mess up other pre-existing mplayer installatons in the system.
cd mplayer-vaapi
mkdir -p ~/bin
cp mplayer ~/bin/mplayer-vaapi

At this point we're pretty much done, try testing it by playing some HD mp4 file with the following parameters: -vo vaapi -va vaapi.
mplayer-vaapi -vo vaapi -va vaapi /path/to/HDvideo.mp4
and enjoy low CPU usage. :-)

If you want to skip inputing these parameters each time you want to use VA-API then simply add the following to ~/.mplayer/config :
vo=vaapi,xv,
va=vaapi


Here's the difference on my system:

Stock MPlayer, no acceleration:


VA-API enabled MPlayer:


This should work across all i3/i5/i7 chipsets (Intel HD 2000 & 3000), feedback welcome.